/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Customer;

import javax.persistence.EntityManager;
import javax.swing.table.DefaultTableModel;
import model.*;
import supermarket.*;
import java.util.*;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;

/**
 *
 * @author aggelos
 */
public class ShowBasketPanel extends javax.swing.JPanel {

    private DBmanager db;
    private EntityManager em;
    private EntityManager ccem;
    private Customer user;
    private MainForm parent;
    private Purchase purchase;
    private MarketPlacePanel MP;
    private DefaultTableModel purchase_model;
    private ArrayList<model.Checks> UserChecks;
    private ArrayList<model.Checks> used_UserChecks;
    private DefaultListModel checks_model;
    private DefaultListModel used_checks_model;

    /**
     * Creates new form ShowBasketPanel
     */
    public ShowBasketPanel(DBmanager db, MainForm parent, MarketPlacePanel MP) {
        this.db = db;
        this.em = db.getEm();
        this.ccem = db.getCcem();
        this.parent = parent;
        this.MP = MP;
        this.user = parent.GetUser();
        initComponents();
        this.setPostage();
    }

    public void setPurchasedProducts() {

        this.purchase = this.MP.getPurchase();

        List<ProductPurchase> pp = this.purchase.getProductPurchaseList();

        Object[] columnNames = {" ", "Όνομα", "Πόντοι", "Τιμή", "Ποσότητα"};

        purchase_model = new DefaultTableModel(new Object[0][0], columnNames);

        this.jTable1.setModel(purchase_model);

        //Βάλε data στον Πίνακα
        int i = 0;
        this.totalPoints.setText("0");
        this.totalPrize.setText("0.0");
        for (ProductPurchase p : pp) {

            Object[] o = new Object[7];

            o[0] = String.valueOf(++i);
            o[1] = p.getProductId().getName();
            o[2] = p.getProductId().getPoints() * p.getQuantity();
            o[3] = p.getProductId().getPrice() * p.getQuantity();
            o[4] = p.getQuantity();
            purchase_model.addRow(o);

            // Calculate Totals
            //points
            int totalpoin = Integer.parseInt(this.totalPoints.getText());
            int addition = p.getProductId().getPoints() * p.getQuantity();
            totalpoin += addition;
            this.totalPoints.setText(String.valueOf(totalpoin));
            //cost
            float totalpri = Float.parseFloat(this.totalPrize.getText());
            float addition1 = p.getProductId().getPrice() * p.getQuantity();
            totalpri += addition1;
            this.totalPrize.setText(String.valueOf(totalpri));
        }

        // Αν Το κόστος είναι πάνω απο 6 ευρώ μπορεί να χρησημοποιηθεί επιταγή
        float totalpri = Float.parseFloat(this.totalPrize.getText());
        if (totalpri > 6.0) {
            this.b_useCheck.setEnabled(true);
        } else {
            this.b_useCheck.setEnabled(false);
        }

        this.populateAvailableChecksList();
    }

    @SuppressWarnings("unchecked")
    private void populateAvailableChecksList() {
        //Get Customer Checks
        List<Checks> AllChecks = this.user.getChecksList();

        // Δημιούργησε την λίστα με τις έγκυρες επιταγές
        this.UserChecks = new ArrayList<model.Checks>();
        for (int i = 0; i < AllChecks.size(); i++) {
            Checks c = AllChecks.get(i);
            if (c.getValid()) {
                this.UserChecks.add(c);
            }
        }

        // Δημιούργησε την λίστα με τις επιταγές που θα χρησημοποιηθούν
        this.used_UserChecks = new ArrayList<Checks>();
        // Δημιούργησε DefaultListModel και συσχετισέτο με την λίστα μας
        this.checks_model = new DefaultListModel();
        this.checksList.setModel(checks_model);
        // Καθάρισε Την λίστα μας
        this.checks_model.removeAllElements();

        //Βάζουμε τα στοιχεία στο model άρα και στην λίστα.
        for (int i = 0; i < this.UserChecks.size(); i++) {
            // Get only valid Checks
            Checks c = this.UserChecks.get(i);
            String AvailCheck = String.valueOf(c.getCheckId());
            this.checks_model.addElement(i + 1 + ". " + AvailCheck);
        }

        // Καθάρισε την λίστα με τις επιταγές που θα χρησημοποιηθούν
        // Δημιούργησε DefaultListModel και συσχετισέτο με την λίστα μας
        this.used_checks_model = new DefaultListModel();
        this.selectedChecksList.setModel(used_checks_model);
        this.used_checks_model.removeAllElements();
        this.used_UserChecks.clear();

        // Αν Το κόστος είναι πάνω απο 6 ευρώ μπορεί να χρησημοποιηθεί επιταγή
        float totalpri = Float.parseFloat(this.totalPrize.getText());
        if (totalpri > 6.0) {
            this.b_useCheck.setEnabled(true);
        } else {
            this.b_useCheck.setEnabled(false);
        }

    }

    private void setPostage() {

        // Αν ο πελάτης δεν έχει  διεύθυνσή , τότε απενεργοποίησε
        // το radio button για την αποστολή στον χώρο του
        if (this.user.getCustomerAddress() == null || this.user.getCustomerAddress().equals("")) {
            this.rb_Post.setEnabled(false);
            this.rb_Store.setSelected(true);
        } else {
            this.rb_Post.setSelected(true);
        }
        // Βάλε και τα δύο radio buttons σε ένα button group
        deliveryButtonGroup.add(this.rb_Post);
        deliveryButtonGroup.add(this.rb_Store);

    }

    public ArrayList<Checks> getUsedChecks() {
        return this.used_UserChecks;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        deliveryButtonGroup = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel2 = new javax.swing.JLabel();
        totalPoints = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        totalPrize = new javax.swing.JTextField();
        jPanelChecks = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        checksList = new javax.swing.JList();
        b_useCheck = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        selectedChecksList = new javax.swing.JList();
        jLabel4 = new javax.swing.JLabel();
        b_abadon_CheckChanges = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        deliveryPanel = new javax.swing.JPanel();
        rb_Post = new javax.swing.JRadioButton();
        rb_Store = new javax.swing.JRadioButton();
        b_conclude = new javax.swing.JButton();
        b_returnToProducts = new javax.swing.JButton();

        jPanel1.setBackground(new java.awt.Color(248, 127, 7));
        jPanel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jPanel1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

        jLabel1.setFont(new java.awt.Font("Ubuntu", 1, 24)); // NOI18N
        jLabel1.setText("Καλάθι Αγορών");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jLabel1))
        );

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        jLabel2.setText("Συνολικοί πόντοι :");

        totalPoints.setText("0");

        jLabel3.setText("Συνολική Τιμή :");

        totalPrize.setText("0.0");

        jPanelChecks.setBorder(javax.swing.BorderFactory.createTitledBorder("Διαχείριση Επιταγών"));

        jScrollPane2.setViewportView(checksList);

        b_useCheck.setText("Χρήση Επιταγής");
        b_useCheck.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                b_useCheckMouseClicked(evt);
            }
        });

        jScrollPane3.setViewportView(selectedChecksList);

        jLabel4.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        jLabel4.setText("ΔιαθέσιμεςΕπιταγές :");

        b_abadon_CheckChanges.setText("Αναίρεση Όλων");
        b_abadon_CheckChanges.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                b_abadon_CheckChangesMouseClicked(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        jLabel5.setText("Επιλεγμένες Επιταγές :");

        javax.swing.GroupLayout jPanelChecksLayout = new javax.swing.GroupLayout(jPanelChecks);
        jPanelChecks.setLayout(jPanelChecksLayout);
        jPanelChecksLayout.setHorizontalGroup(
            jPanelChecksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelChecksLayout.createSequentialGroup()
                .addGroup(jPanelChecksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelChecksLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanelChecksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(b_useCheck, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(b_abadon_CheckChanges, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanelChecksLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGroup(jPanelChecksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(8, 8, 8))
        );
        jPanelChecksLayout.setVerticalGroup(
            jPanelChecksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelChecksLayout.createSequentialGroup()
                .addGroup(jPanelChecksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelChecksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanelChecksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelChecksLayout.createSequentialGroup()
                            .addComponent(b_useCheck)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(b_abadon_CheckChanges))
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        deliveryPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Τρόπος Αποστολής"));

        rb_Post.setText("Αποστολή στο χώρο ");

        rb_Store.setText("Παραλαβή απο κατάστημα");

        javax.swing.GroupLayout deliveryPanelLayout = new javax.swing.GroupLayout(deliveryPanel);
        deliveryPanel.setLayout(deliveryPanelLayout);
        deliveryPanelLayout.setHorizontalGroup(
            deliveryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(deliveryPanelLayout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addComponent(rb_Post)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(rb_Store, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(44, 44, 44))
        );
        deliveryPanelLayout.setVerticalGroup(
            deliveryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(deliveryPanelLayout.createSequentialGroup()
                .addComponent(rb_Post, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, deliveryPanelLayout.createSequentialGroup()
                .addComponent(rb_Store, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        b_conclude.setText("Ολοκλήρωση αγορών");
        b_conclude.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                b_concludeMouseClicked(evt);
            }
        });

        b_returnToProducts.setText("Επιστροφή στα Προιόντα");
        b_returnToProducts.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                b_returnToProductsMouseClicked(evt);
            }
        });
        b_returnToProducts.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                b_returnToProductsActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelChecks, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(totalPoints, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel3)
                        .addGap(4, 4, 4)
                        .addComponent(totalPrize, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(b_returnToProducts)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(b_conclude)
                        .addGap(13, 13, 13))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(deliveryPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(1, 1, 1)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE)
                .addGap(1, 1, 1)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(totalPoints, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel2)
                        .addComponent(jLabel3)
                        .addComponent(totalPrize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelChecks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(deliveryPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(b_conclude, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(b_returnToProducts))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void b_returnToProductsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_b_returnToProductsMouseClicked
        parent.ShowjPanel(8);
    }//GEN-LAST:event_b_returnToProductsMouseClicked

    private void b_useCheckMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_b_useCheckMouseClicked

        int availIndex = this.checksList.getSelectedIndex();
        if (availIndex == -1 || !this.b_useCheck.isEnabled()) {
            return;
        }

        // Αφαίρεσε απο τις Διαθέσιμες επιταγές
        Checks c = (Checks) this.UserChecks.get(availIndex);
        this.UserChecks.remove(availIndex);
        // Ενημέρωσε και την λίστα
        this.checks_model.remove(availIndex);

        //Πρόσθεσε στις επιταγές που θα χρησημοποιηθούν
        this.used_UserChecks.add(c);
        // Ενημέρωσε και την λίστα
        String UseCheck = String.valueOf(c.getCheckId());
        this.used_checks_model.addElement(UseCheck);

        // Αφαίρεσε 6 ευρώ απο κόστος αγοράς
        float totalpri = Float.parseFloat(this.totalPrize.getText());
        totalpri = totalpri - 6;

        // Ενημέρωσε για την καινούργια τιμή.
        this.totalPrize.setText(String.valueOf(totalpri));

        // Αν Το κόστος είναι πάνω απο 6 ευρώ μπορεί να χρησημοποιηθεί επιταγή
        if (totalpri > 6.0) {
            this.b_useCheck.setEnabled(true);
        } else {
            this.b_useCheck.setEnabled(false);
        }

    }//GEN-LAST:event_b_useCheckMouseClicked

    private void b_abadon_CheckChangesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_b_abadon_CheckChangesMouseClicked
        this.setPurchasedProducts();
    }//GEN-LAST:event_b_abadon_CheckChangesMouseClicked

    private void b_concludeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_b_concludeMouseClicked

        // Έλεγχος δεδομένων
        if (this.jTable1.getRowCount() < 1) {
            JOptionPane.showMessageDialog(this, "Το καλάθι είναι κενό.", "Σφάλμα", JOptionPane.WARNING_MESSAGE);
            return;
        }
        if (!this.rb_Post.isSelected() && !this.rb_Store.isSelected()) {
            JOptionPane.showMessageDialog(this, "Δεν έχει γίνει επιλογή του τρόπου αποστολής.", "Σφάλμα", JOptionPane.WARNING_MESSAGE);
            return;
        }

        // Δημιούργησε ένα νέο παράθυρο της φόρμας payForm
        PayForm PF = new PayForm(this.parent, this.MP);
        PF.setVisible(true);
        parent.setEnabled(false);
    }//GEN-LAST:event_b_concludeMouseClicked

    private void b_returnToProductsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b_returnToProductsActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_b_returnToProductsActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton b_abadon_CheckChanges;
    private javax.swing.JButton b_conclude;
    private javax.swing.JButton b_returnToProducts;
    private javax.swing.JButton b_useCheck;
    private javax.swing.JList checksList;
    private javax.swing.ButtonGroup deliveryButtonGroup;
    private javax.swing.JPanel deliveryPanel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanelChecks;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable1;
    private javax.swing.JRadioButton rb_Post;
    private javax.swing.JRadioButton rb_Store;
    private javax.swing.JList selectedChecksList;
    private javax.swing.JTextField totalPoints;
    private javax.swing.JTextField totalPrize;
    // End of variables declaration//GEN-END:variables
}
